import javax.swing.JOptionPane;

public class GradeAnalyzerTester {

	public static void main(String[] args)
	{
		GradeAnalyzer classGrades = new GradeAnalyzer();
		String userInput = "";
		// Loop that requests user input until a 'Q' or 'q' is entered
		while (!userInput.equalsIgnoreCase("Q"))
		{
			userInput = JOptionPane.showInputDialog("Enter a grade or 'q' to quit.");
			if (!userInput.equalsIgnoreCase("Q"))
			{
				double aGrade = Double.parseDouble(userInput);
				classGrades.addGrade(aGrade);
			}
		}
		classGrades.analyzeGrades();
		String gradeReport = classGrades.toString();
		System.out.println(gradeReport);
		System.exit(0);
	}
}
